package com.kaifamiao.wendao.service;

import com.kaifamiao.wendao.dao.LevelDao;
import com.kaifamiao.wendao.entity.Level;

public class LevelService {
    LevelDao levelDao=new LevelDao();
    public boolean create(Long id){
        return levelDao.create(id);
    }

    public boolean update(Level level){
        int l=level.getLogin_time();
        int t=level.getTopic_time();
        int e=level.getExplain_time();
        int b=level.getBuys();
        level.setEmpirical(l*10+t*15+e*5+b);
        return levelDao.update(level);
    }

    public Level find(Long id){
        return levelDao.find(id);
    }
}
